package com.le.beans;

import com.le.utils.Constant;

import java.awt.image.BufferedImage;

// 用于存放障碍物的信息
public class Obstacle {
    // 记录障碍物的坐标
    private int x;
    private int y;
    // 定义一个变量，记录当前障碍物的图片信息
    private BufferedImage obstacleImage;
    // 定义障碍物类型（）
    private int type;
    // 定义一个变量，记录当前的场景
    private BackGround bg;

    // 无参构造方法
    public Obstacle() {
    }

    // 有参构造方法
    public Obstacle(int x, int y, int type, BackGround bg) {
        this.x = x;
        this.y = y;
        this.type = type;
        this.bg = bg;
        // 根据当前的障碍物类型，从常量(Constant)的障碍物集合中获取对应障碍物图片
        this.obstacleImage = Constant.obstacles.get(type);
    }


    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public BufferedImage getObstacleImage() {
        return obstacleImage;
    }

    public void setObstacleImage(BufferedImage obstacleImage) {
        this.obstacleImage = obstacleImage;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public BackGround getBg() {
        return bg;
    }

    public void setBg(BackGround bg) {
        this.bg = bg;
    }
}
